<%--
  Created by IntelliJ IDEA.
  User: 86131
  Date: 2021/8/24
  Time: 15:03
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html>
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <!-- 上述3个meta标签*必须*放在最前面，任何其他内容都*必须*跟随其后！ -->
    <!-- Bootstrap -->
    <link rel="stylesheet" href="css/bootstrap.min.css">
    <!-- jQuery (Bootstrap 的所有 JavaScript 插件都依赖 jQuery，所以必须放在前边) -->
    <script src="js/jquery.min.js"></script>
    <!-- 加载 Bootstrap 的所有 JavaScript 插件。你也可以根据需要只加载单个插件。 -->
    <script src="js/bootstrap.min.js"></script>

    <title>直达车辆页面</title>
</head>
<body>
<div class="container">
       <h3>亲爱的${passengerINFO.userName},为您找到如下直达车次</h3>
    <table class="table table-hover">
        <%--            表格头--%>
        <tr class="success">
            <th>编号</th>
            <th>车次</th>
            <th>日期</th>
            <th>发到站</th>
            <th>时间</th>
            <th>余票</th>
            <th>操作</th>
        </tr>

        <%--    获取 到的真实数据--%>
        <c:forEach items="${throughTrain}" var="train" varStatus="s">
            <tr>
                <td>${s.count}</td>
                <td><h4>${train.trainNumber}</h4>
                        <font color="gray">历时${train.time}</font>
                </td>
                <td>${train.date}</td>
                <td>${train.startStation}<br>
                        ${train.endStation}</td>
                <td><font style="font-weight: bold">${train.startTime}</font><br>
                        ${train.endTime}</td>
                <td><font color="dodgerblue">${train.remainTicket}</font></td>
                <td><a class="btn btn-default btn-sm" href="${pageContext.request.contextPath}/BuyThroughTrainTicket?trainNumber=${train.trainNumber}">购买</a>
                    <a class="btn btn-default btn-sm" href="${pageContext.request.contextPath}/TrainRunningTimeServlet?trainNumber=${train.trainNumber}">查看列车时刻表</a></td>
            </tr>
        </c:forEach>
    </table>


</div>
</body>
</html>
